package com.ycz.pattern.create.abstractfactorypattern;

/**
 * @Description
 * @ClassName FactoryProducer
 * @Author yanchengzhi
 * @date 2023.11.20 00:59
 */
public class FactoryProducer {

    public static AbstractFactory getFactory(String type) {
        if("shape".equalsIgnoreCase(type)) {
            return new ShapeFactory();
        } else if("color".equalsIgnoreCase(type)) {
            return new ColorFactory();
        }
        return null;
    }

}
